libxl: Introduce basic virtio-mmio support on Arm
authorJulien Grall <julien.grall@arm.com>
Fri, 15 Jul 2022 19:20:25 +0000 (22:20 +0300)
committerJulien Grall <jgrall@amazon.com>
Thu, 28 Jul 2022 18:26:37 +0000 (19:26 +0100)
commit2128143c114c52c7536e37c32935fdd77f23edc1
treec43f3a961d570f8194c793e14382999627c395db
parent66dd1c62b2a3c707bd5c55750d10a8223fbd577f
libxl: Introduce basic virtio-mmio support on Arm

This patch introduces helpers to allocate Virtio MMIO params
(IRQ and memory region) and create specific device node in
the Guest device-tree with allocated params. In order to deal
with multiple Virtio devices, reserve corresponding ranges.
For now, we reserve 1MB for memory regions and 10 SPIs.

As these helpers should be used for every Virtio device attached
to the Guest, call them for Virtio disk(s).

Please note, with statically allocated Virtio IRQs there is
a risk of a clash with a physical IRQs of passthrough devices.
For the first version, it's fine, but we should consider allocating
the Virtio IRQs automatically. Thankfully, we know in advance which
IRQs will be used for passthrough to be able to choose non-clashed
ones.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
tools/libs/light/libxl_arm.c
xen/include/public/arch-arm.h